import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import error from '@dfeidao/atom-web/msgbox/error';

export default async function a003(fd: IFeidaoAiBrowserComponent) {
	// 新增保存
	const channel_name = fd.data.node.querySelector<HTMLInputElement>('[id="channel_name"]').value;// 渠道名称
	const rule_name = fd.data.node.querySelector<HTMLSelectElement>('[id="rule_name"]').value;// 风控规则
	// 报备方式
	const arr: string[] = [];
	const checked_all = fd.data.node.querySelectorAll('[name="d_daan"]:checked');
	Array.from(checked_all).forEach((i) => {
		arr.push(i.getAttribute('id'));
	});// 参保 ginseng_state
	let d_daan = "";
	if (arr[0] === "c") {
		d_daan = "全手机号";
	}
	if (arr[0] === "t") {
		d_daan = "手机号前三后四";
	}
	if (!channel_name) {
		return error("请输入渠道名称");
	}
	if (!rule_name) {
		return error("请选择风控规则");
	}
	if (!d_daan) {
		return error("请选择报备方式");
	}
	alert(channel_name);
	alert(rule_name);
	alert(d_daan);
}
